#include "PointLabCore/IPointCloud.h"

namespace PointLabCore
{
	IPointCloud::IPointCloud()
	{
	}

	IPointCloud::~IPointCloud()
	{
	}

	PointLabCore::CLASS_TYPE IPointCloud::classID() const
	{
		return CLASS_TYPE::POINT_CLOUD;
	}

	PointLabCore::Uint IPointCloud::getPointNum() const
	{
		return mPointList.size();
	}

	void IPointCloud::resizePointNum(Uint num)
	{
		mPointList.resize(num);
	}

	void IPointCloud::setPointCoord(Uint pid, const PointLabCore::Vector3& coord)
	{
		mPointList.at(pid) = coord;
	}

	PointLabCore::Vector3 IPointCloud::getPointCoord(Uint pid) const
	{
		return mPointList.at(pid);
	}

	void IPointCloud::appendPointCoord(const PointLabCore::Vector3& coord)
	{
		mPointList.push_back(coord);
	}

	bool IPointCloud::hasNormal() const
	{
		return mNormalList.empty();
	}

	void IPointCloud::resizeNormalNum(Uint num)
	{
		mNormalList.resize(num);
	}

	void IPointCloud::setPointNormal(Uint pid, const PointLabCore::Vector3& normal)
	{
		mNormalList.at(pid) = normal;
	}

	PointLabCore::Vector3 IPointCloud::getPointNormal(Uint pid) const
	{
		return mNormalList.at(pid);
	}

	void IPointCloud::appendPointNormal(const PointLabCore::Vector3& normal)
	{
		mNormalList.push_back(normal);
	}

	bool IPointCloud::hasColor() const
	{
		return mColorList.empty();
	}

	void IPointCloud::resizeColorNum(Uint num)
	{
		mColorList.resize(num);
	}

	void IPointCloud::setPointColor(Uint pid, const PointLabCore::Color4& color)
	{
		mColorList.at(pid) = color;
	}

	PointLabCore::Color4 IPointCloud::getPointColor(Uint pid)
	{
		return mColorList.at(pid);
	}

	void IPointCloud::appendPointColor(const PointLabCore::Color4& color)
	{
		mColorList.push_back(color);
	}

	void IPointCloud::clearAll()
	{
		mPointList.clear();
		mNormalList.clear();
		mColorList.clear();
	}
}